#include "ennemi.h"

QList<QPixmap> Cafard::sprites = QList<QPixmap>();



Cafard::Cafard(Jeu* jeu, float taille):Ennemi(jeu)
{
    this->taille = taille;
    hp = vitalite();
    qDebug() << "new cafard de taille " << taille;
    if (sprites.empty())
    {
        sprites.push_back(QPixmap("Ressources/cafard1.png"));
        sprites.push_back(QPixmap("Ressources/cafard2.png"));
        sprites.push_back(QPixmap("Ressources/cafard3.png"));
    }
}
Cafard::~Cafard()
{
    if (taille >= 2)
    {
        Cafard* c;
        c = new Cafard(jeu,taille/2.0);
        c->setPos(x(),y());
        c = new Cafard(jeu,taille/2.0);
        c->setPos(x(),y());
    }
}
